#include "CPlayerGUI.h"

long CPlayerGUI::m_nMaxMana;
long CPlayerGUI::m_nMaxHealth;
long CPlayerGUI::m_nCurrentMana;
long CPlayerGUI::m_nCurrentHealth;
eSpell CPlayerGUI::m_eCurrentSpell;
long CPlayerGUI::m_nSpellProgress;
long CPlayerGUI::m_nExperience;
long CPlayerGUI::m_nLevel;
long CPlayerGUI::m_nNeededExpToNextLevel;
float CPlayerGUI::m_dCastingTime;
float CPlayerGUI::m_dTotalCastingTime;
float CPlayerGUI::m_dCooldown[TOTAL_SPELLS]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,};
float CPlayerGUI::m_dSpellManaCost[TOTAL_SPELLS]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,};


void CPlayerGUI::setStats                 
	(long _nMaxMana, long _nMaxHealth, long _nCurrentMana, long _nCurrentHealth, 
	eSpell _eCurrentSpell, long _nSpellProgress, long _nExperience, long _nLevel, 
	long _nNeededExpToNextLevel, float _dCastingTime, float _dTotalCastingTime)
{
	m_nMaxMana = _nMaxMana;
	m_nMaxHealth =_nMaxHealth;
	m_nCurrentMana =_nCurrentMana;
	m_nCurrentHealth =_nCurrentHealth;
	m_eCurrentSpell =_eCurrentSpell;
	m_nSpellProgress =_nSpellProgress;
	m_nExperience =_nExperience;
	m_nLevel =_nLevel;
	m_nNeededExpToNextLevel =_nNeededExpToNextLevel;
	m_dCastingTime =_dCastingTime;
	m_dTotalCastingTime= _dTotalCastingTime;
}

sStats CPlayerGUI::getStats()
{
	sStats i;
	
	i.nMaxMana			=m_nMaxMana;
	i.nMaxHealth		=m_nMaxHealth;
	i.nCurrentMana		=m_nCurrentMana;
	i.nCurrentHealth	=m_nCurrentHealth;
	i.eCurrentSpell		=m_eCurrentSpell;
	i.nSpellProgress	=m_nSpellProgress;
	i.nExperience		=m_nExperience;
	i.nLevel			=m_nLevel;
	i.nNeededExpToNextLevel =m_nNeededExpToNextLevel;
	i.dCastingTime		=m_dCastingTime;
	i.dTotalCastingTime	=m_dTotalCastingTime;

	return i;

}


void CPlayerGUI::init()
{
	SpellStat::intialize();
	m_eCurrentSpell=eS_FireBolt;
	m_dCastingTime=0;
	m_dTotalCastingTime = SpellStat::CastingTime[m_eCurrentSpell];
	m_nExperience=0;
	m_nLevel=1;
	m_nNeededExpToNextLevel= ((m_nLevel+1)*(m_nLevel+1)*10);
}
